﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace QunYing.Web.market
{
    public partial class UserMaster : System.Web.UI.MasterPage
    {
        protected override void OnInit(EventArgs e)
        {
            if (Session["userInfo"] == null)
            {
                Response.Redirect("~/Login.aspx");
            }
            base.OnLoad(e);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                lblUserName.Text = ((ArrayList)Session["userInfo"])[1].ToString();
            }
            lblNum.Text = Session["ShopCart"] != null ? ((DataTable)Session["ShopCart"]).Rows.Count.ToString() : "0";
        }
        protected void btnExit_Click(object sender, EventArgs e)
        {
            Session.Remove("userInfo");
            Response.Redirect("~/Login.aspx");
        }
    }
}
